<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>MIT计算机科学及编程导论笔记_Introduction to Computer Science and Programing Note | 宅鱼</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="google-site-verification" content="yH7MwnMb7LXru16F4FAfY94pn-oZLhF8Szu4PuL7Oxw" />
  <meta name="description" content="1.Goal of the course;what is computation;introduction to data types,operators,and variableswhat is knowledge?I can divide knowledge into at least two categories.陈述性知识和程序性知识are declarative and imperati">
<meta name="keywords" content="语言,编程,理论,算法">
<meta property="og:type" content="article">
<meta property="og:title" content="MIT计算机科学及编程导论笔记_Introduction to Computer Science and Programing Note">
<meta property="og:url" content="http://ikkkr.com/2011/10/23/mit-e8-ae-a1-e7-ae-97-e6-9c-ba-e7-a7-91-e5-ad-a6-e5-8f-8a-e7-bc-96-e7-a8-8b-e5-af-bc-e8-ae-ba-e7-ac-94-e8-ae-b0-introduction-to-computer-science-and-programing-note/index.html">
<meta property="og:site_name" content="宅鱼">
<meta property="og:description" content="1.Goal of the course;what is computation;introduction to data types,operators,and variableswhat is knowledge?I can divide knowledge into at least two categories.陈述性知识和程序性知识are declarative and imperati">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2018-04-01T12:38:40.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MIT计算机科学及编程导论笔记_Introduction to Computer Science and Programing Note">
<meta name="twitter:description" content="1.Goal of the course;what is computation;introduction to data types,operators,and variableswhat is knowledge?I can divide knowledge into at least two categories.陈述性知识和程序性知识are declarative and imperati">
  
    <link rel="alternative" href="/atom.xml" title="宅鱼" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.ico"  type="image/x-ico">
   
  <link rel="stylesheet" href="/css/style.css">
  

</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">宅鱼</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">部落格</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">首页</a>
        
          <a class="main-nav-link" href="/archives">文章</a>
        
          <a class="main-nav-link" href="/raincss">RainCSS</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://ikkkr.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-mit-e8-ae-a1-e7-ae-97-e6-9c-ba-e7-a7-91-e5-ad-a6-e5-8f-8a-e7-bc-96-e7-a8-8b-e5-af-bc-e8-ae-ba-e7-ac-94-e8-ae-b0-introduction-to-computer-science-and-programing-note" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2011/10/23/mit-e8-ae-a1-e7-ae-97-e6-9c-ba-e7-a7-91-e5-ad-a6-e5-8f-8a-e7-bc-96-e7-a8-8b-e5-af-bc-e8-ae-ba-e7-ac-94-e8-ae-b0-introduction-to-computer-science-and-programing-note/" class="article-date">
  <time datetime="2011-10-23T14:37:39.000Z" itemprop="datePublished">2011-10-23</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/computer-science/">computer science</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      MIT计算机科学及编程导论笔记_Introduction to Computer Science and Programing Note
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><strong>1.Goal of the course;what is computation;introduction to data types,operators,and variables</strong><br>what is knowledge?<br>I can divide knowledge into at least two categories.<br>陈述性知识和程序性知识<br>are declarative and imperative knowledge.<br>任何可以合法使用值的地方都可以使用变量<br>So,any place it’s legal to use the value.</p>
<p><strong><br>2.Operators and operands statements;branching,conditionals,and iteration</strong><br>分支程序就是一个能基于一些测试来改变指令顺序的程序<br>a branching program is something that can change the order of instructions based on some test</p>
<p><strong><br>3.Common code patterns:iterative programs</strong><br>在写每个循环程序的时候确保他们总是能终结,第二件要做的事情就是要确保程序返回了正确的答案<br>you’d like to be able to assrue yourself that they will always  terminate,and then the second thing you’d like to do,is to assure  yourself that it does give you back a reasonable answer.<br><strong>4.Decomposition and abstraction through functions;introcuction to recursion</strong><br>函数的关键是它要提供分解和抽象<br>the key of the function is that it’s going to provide both of these.<br>将代码分解为模块<br>it’s going to let us break up into modules.<br>忽略细节<br>suppress detail.<br>一种创建原语的思考方式,我们将引用这些原语,这就是继承<br>it is to create new primitives.and i’m going to put those in quotes,it’s a generalization.<br>函数的目的就是寻找计算的共同模式<br>The idea of a function is,that i’m going to capture a common pattern of computation.</p>
<p>这些本地绑定并不影响全局绑定<br>These local bingdings do not affect any global bindings.</p>
<p>递归的概念就是我将把一个问题进行分解成一个更简单的同类问题以解决我可以解决的小步骤<br>The idea of recursion is that I’m going to take a problem and break it  down into a simpler version of the same problem plus some steps</p>
<p>Fibonacci<br>Pairs(0) = 1;<br>Pairs(1) = 1;<br>Pairs(n) = Pairs(n-1) + Pairs(n-2);</p>
<p><strong>5.Floating point numbers,successive refinement,finding roots</strong><br>当我们表达一些数字的时候尾数位于1和2之间,严格的小于2<br>when we represent something,the mantissa is between one and two.Strictly less than two.<br>而指数在-1022到+1023之间<br>The exponent,is in the range,-1022 to +1023<br>因此我们表达的数字可以从正负10到正负308th<br>So this lets us represent numbers up to about 10 to the 308th,plus or minus to the 308th,plus or minus.<br>现代计算机语言是64位的<br>the words today in a modern computer are 64 bits<br>我们设立1位以存储符号这个数字是整数还是负数然后11字节存储指数剩下的52个字节存放尾数(小数)<br>we get one bit for the sign is it a positive or negative number 11 for the exponent,and that leaves 52 for the mantissa</p>
<p>有些10进制的数如1/10 ,在转变为二进制的时候会无限循环下去</p>
<p>打印十进制数字的近似二进制数<br>So on most computers,if you were to print the decimal value of the binary approximation</p>
<p>repr()函数将数字以字符串表达.<br>对于浮点数 计算机截至第17位数<br>for floats,it rounds it to seventeen digits</p>
<p>warry about == on floats<br>每一次猜想都比前一次的更接近答案的方法,这就是逐次逼近法<br>that each guess is better than the previous guess<br>This is what’s called successive approximation<br>起始猜想,然后迭代<br>which would be the initial guess,you then iterate</p>
<p>Bisection method二分法<br>处理过程是对数级的<br>because I am getting logarithmically progressed</p>
<p><strong>6.Bisection methods,Newton/Raphson,introduction to lists</strong></p>
<p>我们实际上是在解方程式f:猜想数的平方减去x<br>we are looking a equation f of guess equals the guess squared minus x.</p>
<p>我们正需求方程式f=0的解.<br>and we trying to solving the equation that f of guess equals 0.Looking for the root of this equation.</p>
<p>sqrt(x);<br>F(guess) = guess^2 -x;</p>
<p>猜想切线(导数)<br>You take a guess and you find the tangent of that guess.</p>
<p>下一个猜想是切线与x的交点.<br>My next guess is going to be where the tangent crosses the x axis.</p>
<p>这里用到了导数的概念,<br>This is where derivatives come in.</p>
<p>我们都知道切点处切线的斜率跟函数在切点处的一阶导数是相同的,也就是dy/dx<br>What we know is that the slope of the tangent is given by the first  derivative of the function f at the point of the guess.Which dy over dx.</p>
<p>guess(i+1) = guess(i) -F(guess(i))/2*guess(i);</p>
<p>可以将第i+1次猜想等于上一次猜想也就是第i次的减去第i次的猜测的结果值除以第i次猜想的本身值<br>we’ll know that we can choose guess i plus 1 to be equal to the old  guess guess i,minus whatever the value is of the new guess–of the old  rather the old guess– divided by twice the old guess.</p>
<p>从猜想数3开始求16平方根<br>F(3) = 9 -16 = -7;<br>guess(i+1) = 3 -(-7/6) = 4.1666</p>
<p><strong>7.Lists and mutability,dictionaries,pseudocode,introduction to efficiency</strong></p>
<p>order of grows<br>-choice of algorithm<br>-map problem into class of algorithms</p>
<p><strong>8.Complexity; log,linear,quadratic,exponential algorithms</strong></p>
<p>增长率,当问题的规模变大时,随之时间和空间的增长<br>Rate of growth as the size of the problem grows.<br>If it was,how much bigger does this get<br>大O符号,代表着当输入增加时也就是问题规模变大时对应的解决方法增长上限<br>Big Oh notation - is basically going to be an upper limit to the growth  of a function as the input grow–as the input gets large.</p>
<p>a的b次方<br>a<strong>b  = (a*a)</strong>(b/2) b even;<br>= a<em>(a**(b-1)) b odd;<br>ef exp3(a,b):<br>if b==1:<br>return a;<br>if(b%2)</em>2 == b:<br>return exp3(a<em>a , b/2);<br>else: return a</em>exp3(a,b-1);<br>b even t(b) = 6 + (b/2);<br>b odd t(b) =  6 + (b-1) = 12 + t((b-1)/2)</p>
<p>t(b) = 12 + (b/2);<br>=12+12+t(b/4)<br>=12k+t(b/2^k)</p>
<p>k=log2 b;<br>In the b even case, again i’m going to let t of b be the number of steps I want to go through.<br>if b is eqaul to 1,and then I’ve got to do the remainder(求余数),the multiplication,and the test,i’m up to four.</p>
<p>And then in the even case I’ve got to do a square(求平方) and the divide.<br>So i’ve got six steps<br>对数级,线性的,平方级,指数级算法<br>log,Linear ,quadratic,exponential algorithm</p>
<p><strong>9.Binary search,bubble and selection sorts </strong></p>
<p>但如果我们用的是保存列表的列表呢?如果列表存储的不同的东西 比如存储的是整数 字符串 浮点数 列表 列表的列表 列表的列表的列表 或者其他各种东西呢?<br>if i know that i have things stored in constant size.But what if i have a  list of lists?What if i have a homogeneous list,a list of integers and  strings and floats and  lists and lists of lists and lists of lists of  lists<br>标准的处理方法是使用链表<br>So in this case,one of the standard ways to use linked list<br>开始我们指向列表的开始<br>Start again,we’ll point to the beginning of the list.<br>在第一点,我们存下一个元素的地址偏移量,然后 用之后连续的几个单元表示第一个元素 如果你喜欢也可以说是第0个元素.在这里  我可能需要五个内存单元在下一个位置中 存放需要多大的内存偏移量跳转到下一个元素然后无论你想存放什么都可以放在接下来的单元中 可能只是些空格<br>在下一点可能我得存放一个很长的列表了</p>
<p>in the first spot,I am going to store something that says,here’s how far  you have to jump to get to the next element.And then,I am going to use  the next sequence of things to represent the first element,or the  zero-th element,if you like.In this case I might need five.And then in  the next spot,I am going to say how far you have to jump to get to the  next element.All right,followed by whatever i need to represent it,which  might only be a blank one.And in the next spot,maybe I’ve got a really  long list</p>
<p>here is the problem.How do i get to the nth er,the k’th element in the list,in this case?<br>Well i have to go to the zero-th element,and say OK,gee,to get to the  next element,I’ve got to jump this here.And to get to the next  element,I’ve got to jump to here,and to get to the next element,I’ve got  to jump to here,until i get there.<br>primarily Lisp.<br>盒状指南针每个元素实际上由两部分组成这里我们颠倒了顺序 这里有指针指向内存包含实际值的地址 可能实际值也是一系列指针 这里还有指向实际指向下一个元素的指针<br>Python store list, it is called a box pointer diagram,what we really  have for each element is two things.And i’ve actually just reversed the  order here.we have a pointer to the location in memory that contains the  actual value,which itself might be a bunch of pointers,and we have a  pointer to the actual a pointer the value and we have a pointer</p>
<p>一次一个的比较遍历这些元素直到找到了它,这个复杂度是n<br>I am just going to take an unsorted list and search it,i cound do it in  linear time,right?One at a time.Walk down the elements until i find  it.That wound be order n.<br>另一种方法,先排序再搜索,需要花nlog n时间排序,然后花log n时间搜索<br>On the other hand,sort it first,and search.take n logn time to sort it,then i can search it in log n time.</p>
<p>amortize the cost.<br>Linear   sort + search<br>kn      nlog n + klog n</p>
<p>bubbule sort<br>我遍历一次列表 每次取两个值 确认最大的元素在后面一个<br>I’m walking along the list once,taking two things,and saying, make sure the biggest one is next.</p>
<p>所以无论最大的元素在列表的什么位置 跑完了一遍 它总是在最下面 然后我回来再做一次,下一个最大元素又能跑到倒数第二的位置.<br>So wherever the largest element started out in the list,by the time i  get through it,it’s at the end.And then i go back and i start again,and i  do the same thing.The next largest element has to end up in the second  last spot.</p>
<p>divide and conquer algorithm<br>分而治之</p>
<p><strong>10. Divide and conquer methods,merge sort,exceptions</strong></p>
<p>merge sort</p>
<p>所以我在树的每个层次都要做O(n)的操作,因为在每一层 我都是把问题分解成两半,以n开始 然后是n/2 n/4 n/8 所以我log n遍的n次操作<br>have order n operations at each level in the  tree.And then we have Log n  level,Beacause at each stage i cute problem in half.So i start off with  n then it’s n over two n over four n over eight.So i have n operations  log n times, n log n</p>
<p>hashing<br>Trade space for time 用空间换时间</p>
<p><strong>11. Testing and Debugging</strong></p>
<p>validation<br>progress to uncover problem and increase confidence.<br>我们需要一种不会我们这种无保证的自信的方法<br>So we need to have a method not designed to give us unwarranted confidence.</p>
<p>是两件事情的组合 测试和推理<br>It’s typically a combination of two things.Testing and reasoning.<br>测试就是 我们输入一些信息并且运行我们的程序 然后查看答案<br>Testing we run our program on some set of inputs.And check the answers,and say yeah</p>
<p>debugging<br>这其实是一个查明为什么程序不运行或者不按期待运行的过程<br>And that’s basically the process of ascertaining why the program is not working.</p>
<p>Defensive programming.防卫性程序设计</p>
<p>And that’s basically writing your programs in such a way that it will  facilitate both validation and dubugging.</p>
<p>实验必须有做什么的能力才能被称为一个有效的科学实验呢?<br>what must this experiment have the potential to do,to be a valid scientific experiment?<br>实验必须有反驳我们假设的可能<br>It must have the potential to refute the hypothesis.</p>
<p><strong>12. More about debugging,knapsack problem,introduction to dynamic programming</strong></p>
<p>first,keep in mind that the bug is probably not where you think it is.</p>
<p>simple things you can care:</p>
<p>自变量顺序错误<br>Reversed order of arguments.</p>
<p>忘记初始化<br>Initialization.</p>
<p>对象与值相等<br>Object versus value equality.</p>
<p>别名<br>Aliasing deep vs shallow capy.</p>
<p>Keep record of what you tried.</p>
<p>Think about reconsidering your assumptions.</p>
<p>Bin packing</p>
<p>sequence alignment</p>
<p>Knapsack problem 背包问题</p>
<p>Continuous problem 连续问题<br>4/bs Au dust<br>3/bs Ag dust<br>10/bs Raisins</p>
<p>function is cost value of gold times how many pounds of gold.Plus the  cost of silver times however many pounds of silver.Plus cost of raisins  times the number of pounds of raisins.<br>maximize the function Cg <em> PG + Cs </em> PS + Cr * PR</p>
<p>the constraint is PG + PS + PR &lt;=8<br>Greedy algorithm<br>at every step you do what maximizes your value at that step.So there’s no planning ahead.You just do what is ever best.</p>
<p>Locally optinal  not always lead to global optimums.</p>
<p>zero-one knapsack problem 0/1 背包问题<br>exhaustive enumeration 穷举法</p>
<p>E(n ,i = 1) W i X i &lt;= C</p>
<p>Dynamic programming</p>
<p>有重叠子问题且被称为最理想子结构的情况<br>there are overlapping sub-problems and what’s called optimal substructrue.</p>
<p>redundant computation 累赘计算</p>
<p><strong>13.Dynamic programming: overlapping subproblems,optimal substructure</strong></p>
<p>Overlapping subproblems 重叠子问题<br>Memoization<br>我们在第一次计算一个值后就记录一个值.然后在后续问题中使用这个值.<br>we record a value the first time it’s computed,then look it up the subsequent times we need it.</p>
<p>这就是动态编程这种通用技术的核心<br>And this is what lies at the heart of this very general technique called dynamic programming.</p>
<p>实际上 它也是很多保存结果的计算技巧的核心<br>And in fact,it lies at the heart of a lot of useful computational techniques where we save results.</p>
<p>Decision Tree 决策树<br>Back track</p>
<p><strong>14.Analysis of knapsack problem,introduction to object-oriented programming</strong></p>
<p>Size of solution<br>运行时间与装进背包的物品数目有关<br>how long it takes to run is related to how many items i end up being able to  fit into the knapsack.<br>要记住的物品数量是和我能在背包中装多少东西有关<br>So the number of items i have to remember is related to how many items i can fit in the Knapsack.</p>
<p>这里有的是伪多项式算法<br>so we’d much rather define big O in terms of the inputs.</p>
<p>通常我们查看计算复杂度O的时候 我们会把它定义为实现输入的代码的大小<br>computational complexity,big O,what we’ll define the in terms of,is the size of the coding of the input.<br>size of coding of input</p>
<p>Pseudo polynomial algorithm 伪多项式</p>
<p>polynomial in the  numeric value of input</p>
<p>1.动态编程中,我们是在用空间换时间<br>In dynamic programming, one of the things that’s going on is we’re trading time for space.</p>
<p>2. 不要被指数型问题吓到<br>Two,don’t be intimidated by exponential problems.</p>
<p>3. 动态编程有广泛的应用,每当你在处理一个看上去有自然而然的递归算法的时候</p>
<p>Dynamic programming is broadly useful.Whenever you’re looking at a  problem that seems to have a natural recursive solution,think about  whether you can attact it with dynamic programming.</p>
<p>4. 减少问题 problem reduction</p>
<p>Module (modularity)<br>我想要说的是一种类型的模块当然这是因为我们关注的是程序的可组合性<br>what i want to be talking about is modules of one sort,and of course that’s because what we’re interested in is modularity.</p>
<p>模块是相识函数的集合<br>Now i think of a module as a collection of related functions.</p>
<p>我们将要通过圆点标记法来使用函数( . )<br>and we’re going to refer to the functions using dot notation.</p>
<p>一种特殊的模块,模块中包括了类或者它们本身就是类<br>a particular kind of module,and those are the modules that include classes or that are classes.</p>
<p>在这个问题上我们将要强调要在面向对象编程的环境中使用类<br>In this subject we’re going to emphasize using classes in the context of what’s called object-oriented programming.</p>
<p>data abstractions<br>Abstract data type</p>
<p>对象就是数据和函数的集合<br>An object is a collection of data and functions.<br>这里关键思想就是将函数和操作数据的函数绑在一起成为一个东西<br>The key idea here is to bind together the data and the functions that operate on that data as a single thing.</p>
<p>user defind types<br>数据与函数的结合是面向对象编程的核心<br>This combining of data and functions on that data is a very essence of object-oriented programming.</p>
<p>we also call it encapsulation 封装</p>
<p>消息传递 传递隐喻的消息<br>we talk about it in terms of message pass, a message passing metaphor.</p>
<p>one object can pass a message to another object and the receiving object responds by executing one of its methods on the object.</p>
<p>l.sort();<br>这个对象传递一个消息sort 这个消息让我们去找sort方案,然后应用到对象I<br>pass the object I the message sort,and that message says find the method sort,and apply it to the object I.</p>
<p>notion of an instance.<br>类是有相同特质对象的集合<br>A class is a collection of objects with characteristics in common.</p>
<p>and extend the language.</p>
<p><strong>15.Abstract data types,classes and methods</strong></p>
<p>Class ,a template for creating instances of an object.<br>类是创建对象实例的模板</p>
<p>浅意义上的相等和深意义上的相等<br>shallow equality and deep equality.</p>
<p>测试浅意义上的相等<br>The first thing is testing shallow equality.<br>它本质是说,对于给定的两个东西它们是不是指向同一个引用<br>is essentially saying,given 2 things,do they point to exactly the same referent?<br>看看这两个是否指向内存中的同一位置.<br>is saying,do these things point to exactly the same spot in memory.</p>
<p>建立不同的版本的这些东西的一个模板<br>that’s going to let us build versions of these things.</p>
<p>这里有一个奇怪的额外的名为self的变量<br>There’s this weird extra variable in there called self.</p>
<p>当我创建了一个实例我应该能够获得那些特性化这个实例的东西<br>When i create a instance,i have to be able to get access to the things that characterize that instance.<br>这里特性化这个实例的东西是内在的详细说明要做什么的参数<br>what characterizes an instance here,it’s the internal parameters that specify what is going on.</p>
<p><strong>init</strong>  –when we call it, create an instance<br>–use “self” to refer to that instance</p>
<p>init方法创建了一个指向这个实例的指针<br>Init create a pointer to the instance.</p>
<p>把self作为指向这个实例的指针传了进去<br>And then it needs to have access to that,so it calls it passing in self as the pointer to the instance.</p>
<p>init这个方法可以去访问内存中的这一块了 然后在这块内存里面<br>it says it has access to that piece in memory,and now inside of that piece of memory</p>
<p>self will always point to the particular instance.<br>same other programming languages do not provide that pointer.</p>
<p>Methods - can access values of the specific instance.</p>
<p>Data hiding<br>一个人仅仅可以通过定义好的方法来访问实例变量</p>
<ul>
<li>one can only access instance values through defined methods.</li>
</ul>
<p>python doesnot do this</p>
<p><strong>str</strong> - printed representation,it converts things into a string type.代表打印,将东西转为字符串格式.</p>
<p><strong>cmp</strong> - doing comparisons.</p>
<p>Operate overloading</p>
<p>Instance (</p>
<ul>
<li>methods</li>
<li>fields<br>)<br>attributes</li>
</ul>
<p>与实例相关联的是方法和域,它们统称为实例的属性<br>associated with an instance,we have both methods and fields.these are both called attributes of the instance.</p>
<p><strong>16.Encapsulation,inheritance,shadowing</strong></p>
<p>class<br>是一种将数据聚集起来的数据,这是模块/抽象的概念,在这里都把它们当作了原语<br>just trying to cluster data together.And this is a notion of modularity slash abstraction,where i’m treating them as primitives.</p>
<p>类将会创建实例,也就是该结构的特例<br>Class is used to make instances,meaning particular versions,of that structure</p>
<p>当我们调用person类定义的时候,它就创建了一个实例<br>when we called the class definition,person,it create an instance,there it is.</p>
<p>把它想成是指向内存中一点的指针,然后我们所做的是初始化成员函数<br>Thinkd of it as a pointer to a spot in memory,and then what  we do is,then we call,or find that init method.</p>
<p>初始化(init)成员函数<br>And the first argument self,points to the instance.</p>
<p><strong>17.Computational models:random walk simulation</strong></p>
<p>探索一些随机性<br>Dealing with &amp; exploiting randomness</p>
<p>随机指标  它们包含了一些随机性<br>Stochastic they incorporate randomness.</p>
<p>弄清数据的概念<br>Making sense of data</p>
<p>当我们在 再说一次 在对世界进行建模 我们发现里面有大量的数据<br>As we look at,again,modeling the world,what we discover,there’s a lot of data out there</p>
<p>评价答案的质量<br>Evalvating quality of answers</p>
<p>从简单的地方入手<br>Start Simple</p>
<p>也就是从一些对真实问题的简单估算开始<br>So start with some simple approximation to the real problem.</p>
<p>我会去假设 就像我们之前做的一样 我们有一个笛卡尔坐标系,玩家是站在一片像坐标纸一样的场地上<br>And I’m going to assume,as we’ve seen before,that we have Cartesian  coordinates and that the player is standing on a field that has been cut  to resemble a piece of graph paper.</p>
<p>只能选择四个方向中的一个:北 南 东或西<br>only go in one of four directions: north, south, east, or west.</p>
<p>然后对着一个方向迈出一步.不失去一般性<br>student is here and takes a step in one direction or another.without loss of generality</p>
<p>有四分之三的几率学生离出发点更远了<br>three times out of four you get further away.</p>
<p>模拟无规则运动<br>Simulate random walk</p>
<p>模拟 也就是我们去尝试着建立一个假扮成真实世界的模型然后模拟一些东西<br>Simulation where we try build the model that pretends it’s the real world and simulates what goes on,and a random walk.</p>
<p>来尝试着给你们做一个实例分析<br>Trying to give you a case study</p>
<p>开始去想象合适的抽象数据是什么<br>Thinking about what might be the appropriate data abstractions.</p>
<p>位置<br>Location</p>
<p>Compass point</p>
<p>Field</p>
<p>Drunk</p>
<p>罗经点的数据抽象来代表这个学生会朝北 南 东 西 四个方向走<br>compass point to capture the notion that the student is going north,south,east,or west.</p>
<p>把位置和方向的概念分离开了<br>separate the notion of direction</p>
<p>因此可以把它当作是一个完全的笛卡尔平面而这个人所处的位置就是平面上的一个点<br>So think of that as the whole Cartesian plain,as opposed to a point in the plane,which is what the location is.<br>因为全部问题是关于这个喝醉的人现在在哪儿的<br>since after all the whole problem talks about where the drunk is.</p>
<p>pseudo random</p>
<p><strong>18.Presenting simulation results,Pylab,plotting</strong></p>
<p>执行一个模拟实验的内循环<br>1) we start with an inner loop that simulates one trail.</p>
<p>然后我会把这个内循环”包”在执行恰当数量的实验的循环中<br>2)And then i’ll quoto,enclose,unquote the inner loop in another loop that conducts an appropriate number of trials.</p>
<p>计算实验的统计数据并将它们表示出来<br>3)Calculate and present some relevant statistics about the trials.</p>
<p><strong>19.Biased random walks,distributions</strong></p>
<p>有偏的随机漫步</p>
<p>Polymorphism 多态性</p>
<p>尝试创建一个代表性的场景<br>Generate a sample of representative scenarios.</p>
<p>因为穷举所有可能的洲是不大可能的<br>Because an exhaustive enumeration of all possible states would be impossible.</p>
<p>你可以穷举空间,然后看看它会得到什么结果<br>you can exhaustively enumerate the space and then see what’s going on.</p>
<p>Experimental device</p>
<p>I’m running an experiment designed to give me some information about the real world.</p>
<p>他们都是描述性的而非预测性的<br>they are typically descriptive not presciptive.</p>
<p>they describe a situation,they don’t tell you what the answer is.</p>
<p>模拟并不是一个最优化过程<br>a simulation is not an optimization procedure.When we looked at  optimization,that was prescriptive.We ran an optimization algorithm,and  it gives us the best possible solution.</p>
<p><strong>20.Monte Carlo simulations,estimating pi</strong></p>
<p>将模拟模型进行分类的不同途径<br>classify simulation models.<br>是随机还是确定性的问题<br>it’s stochastic or deterministic</p>
<p>静态还是动态<br>static vs dynamic time</p>
<p>第三个分歧就是离散和连续<br>A third dichotomy is discrete vs continuous.</p>
<p>21.Validating simulation results,curve fitting,linear regression<br>验证模拟结果,曲线拟合,线性回归</p>
<p>How many samples?<br>How accurate?<br>Biased sample</p>
<p>Data<br>Models that explain data<br>Consequences that follow from the models</p>
<p>Whenever we try and fit something,We need some sort of an objective function.</p>
<p>Least squares fit</p>
<p>进行最优化的方式,实际上还有更有效率的办法<br>It turns out that for this particular optimization,there’s something more efficient.</p>
<p>对这种问题有一个闭型解决方案<br>there is a closed form way of attacting this</p>
<p>线性回归<br>Linear regression</p>
<p>因变量y和自变量的关系是这些参数的线性函数<br>the relationship of the dependent variable y to the independent variables is assumed to be a linar function of the parameters.</p>
<p>R2 - coefficient of determination</p>
<p>R2 = 1 - EE/Dr</p>
<p>就是它通过模型中的变量去尝试获取因变量的比例<br>It’s attempting to capture the proportion of the response variation explained by the variables in the model.</p>
<p>所以你可以看到一部分值的改变是因为变量值的改变<br>So you’ll have some amount of variation that is explained by changing the values of the variables</p>
<p>我有一些预测数据 如果你愿意<br>So e e is going to be the errors in the estimation.</p>
<p>r2 = 0.9</p>
<p>基本上这些变量90%的改变都能靠这个模型来解释<br>approximately 90 percent of the variation in the variables can be explained by the model.</p>
<p>潜在变量<br>lurking variable</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/理论/">理论</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/算法/">算法</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/编程/">编程</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/语言/">语言</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2011/11/06/e5-af-bc-e6-95-b0-e4-b8-8e-e7-89-9b-e9-a1-bf-e8-bf-ad-e4-bb-a3-e6-b3-95-derivative-and-newton-iterative-algorithm/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          导数与牛顿迭代法_Derivative and Newton iterative algorithm
        
      </div>
    </a>
  
  
    <a href="/2011/10/14/css3-2d-e5-92-8c3d-e7-9f-a9-e9-98-b5-e7-9a-84-e5-8e-9f-e7-90-86-css3-2d-and-3d-matrix/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">CSS3 2D和3D矩阵的原理_CSS3 2D and 3D matrix</div>
    </a>
  
</nav>

  


<div class="ds-thread" data-thread-key="2011/10/23/mit-e8-ae-a1-e7-ae-97-e6-9c-ba-e7-a7-91-e5-ad-a6-e5-8f-8a-e7-bc-96-e7-a8-8b-e5-af-bc-e8-ae-ba-e7-ac-94-e8-ae-b0-introduction-to-computer-science-and-programing-note/"></div>

</article></section>
        
          <aside id="sidebar">
  
    <div class="widget-wrap">
  <h3 class="widget-title">Github</h3>
  <div class="widget">
    <ul class="category-list"><li class="category-list-item"><a href="https://github.com/rainzhai">https://github.com/rainzhai</a></li></ul>
  </div>
</div>

  <div class="widget-wrap">
    <h3 class="widget-title">分类 Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS/">CSS</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/">CSS &amp; HTML</a><span class="category-list-count">29</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/html5/">html5</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/javascript-amp-Ajax/">javascript &amp; Ajax</a><span class="category-list-count">2</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/javascript-amp-Ajax/移动端开发/">移动端开发</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/web-development/">web development</a><span class="category-list-count">2</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/web-development/移动端开发/">移动端开发</a><span class="category-list-count">1</span></li></ul></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/blog/">blog</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/">computer science</a><span class="category-list-count">10</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/java-web/">java web</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/web-development/">web development</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/算法/">算法</a><span class="category-list-count">2</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/html5/">html5</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hybrid/">hybrid</a><span class="category-list-count">2</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/hybrid/phonegap/">phonegap</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/java-web/">java web</a><span class="category-list-count">10</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/">javascript &amp; Ajax</a><span class="category-list-count">23</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/jquery/">jquery</a><span class="category-list-count">1</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/jquery/web-development/">web development</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/web-development/">web development</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/算法/">算法</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/jquery/">jquery</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nodejs/">nodejs</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/php/">php</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/web-development/">web development</a><span class="category-list-count">15</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/前端/">前端</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/智趣/">智趣</a><span class="category-list-count">5</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/智趣/游戏/">游戏</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/智趣/生活/">生活</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/未分类/">未分类</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/模块化/">模块化</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/游戏/">游戏</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/生活/">生活</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/资源/">资源</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签 Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Angularjs/">Angularjs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS/">CSS</a><span class="tag-list-count">21</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS-3/">CSS 3</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/D2/">D2</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/DIY/">DIY</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Design/">Design</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Structure/">Structure</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/android/">android</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/app/">app</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/blog/">blog</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/bug/">bug</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/css3/">css3</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/debug/">debug</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dojo/">dojo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/easy-ui/">easy ui</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/firefox/">firefox</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/flash/">flash</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/free-hosting/">free hosting</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/game/">game</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/geekTime/">geekTime</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/html/">html</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/html5/">html5</a><span class="tag-list-count">18</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hybrid/">hybrid</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ie/">ie</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ios/">ios</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javascript/">javascript</a><span class="tag-list-count">28</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jquery/">jquery</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jquery-mobile/">jquery mobile</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jsp/">jsp</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mobile/">mobile</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nodejs/">nodejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/npm/">npm</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/photos/">photos</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/php/">php</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/requirejs/">requirejs</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/seam/">seam</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/svg/">svg</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/threejs/">threejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ued/">ued</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/w3c标准/">w3c标准</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web/">web</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webapp/">webapp</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webgl/">webgl</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webpage/">webpage</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wordpress/">wordpress</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/上下文/">上下文</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/分享/">分享</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/前端/">前端</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/前端-Javascript-css-ES6/">前端 Javascript css ES6</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/学习/">学习</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/性能/">性能</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/总结/">总结</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/效率/">效率</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/模块化/">模块化</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/游戏/">游戏</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/理论/">理论</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/生活/">生活</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/社会化网络/">社会化网络</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/移动/">移动</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/移动端开发/">移动端开发</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/算法/">算法</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/编程/">编程</a><span class="tag-list-count">18</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/美女/">美女</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/翻译/">翻译</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/范式/">范式</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/设计模式/">设计模式</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/语义网/">语义网</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/语言/">语言</a><span class="tag-list-count">21</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/资源/">资源</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/转载/">转载</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/面向对象/">面向对象</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/风景/">风景</a><span class="tag-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签云 Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Angularjs/" style="font-size: 10px;">Angularjs</a> <a href="/tags/CSS/" style="font-size: 19.09px;">CSS</a> <a href="/tags/CSS-3/" style="font-size: 13.64px;">CSS 3</a> <a href="/tags/D2/" style="font-size: 10px;">D2</a> <a href="/tags/DIY/" style="font-size: 10px;">DIY</a> <a href="/tags/Design/" style="font-size: 10.91px;">Design</a> <a href="/tags/Structure/" style="font-size: 16.36px;">Structure</a> <a href="/tags/android/" style="font-size: 10px;">android</a> <a href="/tags/app/" style="font-size: 10px;">app</a> <a href="/tags/blog/" style="font-size: 10.91px;">blog</a> <a href="/tags/bug/" style="font-size: 10px;">bug</a> <a href="/tags/css3/" style="font-size: 14.55px;">css3</a> <a href="/tags/debug/" style="font-size: 10px;">debug</a> <a href="/tags/dojo/" style="font-size: 10px;">dojo</a> <a href="/tags/easy-ui/" style="font-size: 10px;">easy ui</a> <a href="/tags/firefox/" style="font-size: 10px;">firefox</a> <a href="/tags/flash/" style="font-size: 10px;">flash</a> <a href="/tags/free-hosting/" style="font-size: 10px;">free hosting</a> <a href="/tags/game/" style="font-size: 10px;">game</a> <a href="/tags/geekTime/" style="font-size: 10px;">geekTime</a> <a href="/tags/html/" style="font-size: 13.64px;">html</a> <a href="/tags/html5/" style="font-size: 18.18px;">html5</a> <a href="/tags/hybrid/" style="font-size: 11.82px;">hybrid</a> <a href="/tags/ie/" style="font-size: 10.91px;">ie</a> <a href="/tags/ios/" style="font-size: 10px;">ios</a> <a href="/tags/java/" style="font-size: 17.27px;">java</a> <a href="/tags/javascript/" style="font-size: 20px;">javascript</a> <a href="/tags/jquery/" style="font-size: 15.45px;">jquery</a> <a href="/tags/jquery-mobile/" style="font-size: 10.91px;">jquery mobile</a> <a href="/tags/jsp/" style="font-size: 10px;">jsp</a> <a href="/tags/mobile/" style="font-size: 10.91px;">mobile</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/npm/" style="font-size: 10px;">npm</a> <a href="/tags/photos/" style="font-size: 10px;">photos</a> <a href="/tags/php/" style="font-size: 10px;">php</a> <a href="/tags/requirejs/" style="font-size: 10.91px;">requirejs</a> <a href="/tags/seam/" style="font-size: 10.91px;">seam</a> <a href="/tags/svg/" style="font-size: 10px;">svg</a> <a href="/tags/threejs/" style="font-size: 10px;">threejs</a> <a href="/tags/ued/" style="font-size: 10.91px;">ued</a> <a href="/tags/w3c标准/" style="font-size: 12.73px;">w3c标准</a> <a href="/tags/web/" style="font-size: 13.64px;">web</a> <a href="/tags/webapp/" style="font-size: 10.91px;">webapp</a> <a href="/tags/webgl/" style="font-size: 10px;">webgl</a> <a href="/tags/webpage/" style="font-size: 10.91px;">webpage</a> <a href="/tags/wordpress/" style="font-size: 11.82px;">wordpress</a> <a href="/tags/上下文/" style="font-size: 10px;">上下文</a> <a href="/tags/分享/" style="font-size: 10.91px;">分享</a> <a href="/tags/前端/" style="font-size: 16.36px;">前端</a> <a href="/tags/前端-Javascript-css-ES6/" style="font-size: 10px;">前端 Javascript css ES6</a> <a href="/tags/学习/" style="font-size: 10px;">学习</a> <a href="/tags/性能/" style="font-size: 12.73px;">性能</a> <a href="/tags/总结/" style="font-size: 10.91px;">总结</a> <a href="/tags/效率/" style="font-size: 11.82px;">效率</a> <a href="/tags/模块化/" style="font-size: 10.91px;">模块化</a> <a href="/tags/游戏/" style="font-size: 11.82px;">游戏</a> <a href="/tags/理论/" style="font-size: 14.55px;">理论</a> <a href="/tags/生活/" style="font-size: 10.91px;">生活</a> <a href="/tags/社会化网络/" style="font-size: 10.91px;">社会化网络</a> <a href="/tags/移动/" style="font-size: 10px;">移动</a> <a href="/tags/移动端开发/" style="font-size: 10px;">移动端开发</a> <a href="/tags/算法/" style="font-size: 13.64px;">算法</a> <a href="/tags/编程/" style="font-size: 18.18px;">编程</a> <a href="/tags/美女/" style="font-size: 10px;">美女</a> <a href="/tags/翻译/" style="font-size: 13.64px;">翻译</a> <a href="/tags/范式/" style="font-size: 12.73px;">范式</a> <a href="/tags/设计模式/" style="font-size: 11.82px;">设计模式</a> <a href="/tags/语义网/" style="font-size: 10px;">语义网</a> <a href="/tags/语言/" style="font-size: 19.09px;">语言</a> <a href="/tags/资源/" style="font-size: 10.91px;">资源</a> <a href="/tags/转载/" style="font-size: 10px;">转载</a> <a href="/tags/面向对象/" style="font-size: 10px;">面向对象</a> <a href="/tags/风景/" style="font-size: 10px;">风景</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">文章 Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/07/">July 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/06/">June 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/">August 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/07/">July 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/">April 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/03/">March 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/08/">August 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/03/">March 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/12/">December 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/11/">November 2014</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/10/">October 2014</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/05/">May 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/04/">April 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/03/">March 2014</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/02/">February 2014</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/01/">January 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/12/">December 2013</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/11/">November 2013</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/10/">October 2013</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/09/">September 2013</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/08/">August 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/07/">July 2013</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/06/">June 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/05/">May 2013</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/03/">March 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/01/">January 2013</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/11/">November 2012</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/08/">August 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/06/">June 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/05/">May 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/04/">April 2012</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/03/">March 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/02/">February 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/01/">January 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/12/">December 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/11/">November 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/10/">October 2011</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/09/">September 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/08/">August 2011</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/07/">July 2011</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/06/">June 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/04/">April 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/02/">February 2011</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/01/">January 2011</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/12/">December 2010</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/11/">November 2010</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/10/">October 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/09/">September 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/08/">August 2010</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/06/">June 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/04/">April 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/01/">January 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2009/08/">August 2009</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最近 Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2018/07/23/nvm安装问题处理-nvm-is-not-compatible-with-the-npm-config-prefix-option-错误/">nvm安装问题处理 nvm is not compatible with the npm config prefix option 错误</a>
          </li>
        
          <li>
            <a href="/2018/06/06/前端知识体系大全/">前端知识体系大全</a>
          </li>
        
          <li>
            <a href="/2016/08/28/使用Angularjs开发控制台类项目/">使用Angularjs开发控制台类项目</a>
          </li>
        
          <li>
            <a href="/2016/07/11/Apicloud开发app的问题总结/">Apicloud开发app的问题总结</a>
          </li>
        
          <li>
            <a href="/2016/04/25/前端面试经典问题/">前端面试经典问题</a>
          </li>
        
      </ul>
    </div>
  </div>

  
      <div class="widget-wrap">
<h3 class="widget-title">友情链接 Links</h3>
<div class="widget">
<ul>
<li><a href="http://wande.me" title="玩的么" target="_blank">玩的么</a></li>
</ul>
</ul>
</div>
  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2018 宅鱼<br>
      更多游戏： <a href="http://wande.me"  target="_blank">玩的么</a><br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">首页</a>
  
    <a href="/archives" class="mobile-nav-link">文章</a>
  
    <a href="/raincss" class="mobile-nav-link">RainCSS</a>
  
</nav>
    <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"rainzhai"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
     || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
  </script>
<!-- 多说公共JS代码 end -->

<script type="text/javascript" src="http://wandeme.com/js/jquery-1.7.2.min.js"></script>

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F49ba6eabd43121d820d9120777bdaf30' type='text/javascript'%3E%3C/script%3E"));
</script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>

  </div>
</body>
</html>